namespace Medical.Domain
{
    /// <summary>
    /// 用户实体（用于登录认证）
    /// </summary>
    public class User
    {
        /// <summary>
        /// 用户ID（主键）
        /// </summary>
        public long UserId { get; set; }
        
        /// <summary>
        /// 用户名（登录名，唯一）
        /// </summary>
        public string UserName { get; set; } = string.Empty;
        
        /// <summary>
        /// 密码（加密后）
        /// </summary>
        public string PasswordHash { get; set; } = string.Empty;
        
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }
        
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string? FullName { get; set; }
        
        /// <summary>
        /// 手机号
        /// </summary>
        public string? Phone { get; set; }
        
        /// <summary>
        /// 关联的员工ID（可选，用于关联Employee表）
        /// </summary>
        public long? EmployeeId { get; set; }
        
        /// <summary>
        /// 是否激活
        /// </summary>
        public bool IsActive { get; set; } = true;
        
        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? LastLoginAt { get; set; }
        
        /// <summary>
        /// 最后登录IP
        /// </summary>
        public string? LastLoginIp { get; set; }
        
        /// <summary>
        /// 是否已删除（逻辑删除标记）
        /// </summary>
        public bool IsDeleted { get; set; } = false;
        
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DeletedAt { get; set; }
        
        /// <summary>
        /// 删除操作人
        /// </summary>
        public string? DeletedBy { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; } = DateTime.Now;
        
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedAt { get; set; } = DateTime.Now;
    }
}

